/*
 * @Description:
 * @Author: william
 * @Date: 2024-08-22 11:47:45
 * @LastEditors: william
 * @LastEditTime: 2025-09-23 15:41:52
 */

let env = ''

// #ifdef MP-WEIXIN
// 获取当前帐号信息
const accountInfo = uni.getAccountInfoSync()

// env类型
env = accountInfo.miniProgram.envVersion

if (!env) {
  console.error('获取运行环境失败！')
}
// #endif

// #ifdef H5 || APP-ANDROID || APP-PLUS
env =
  {
    development: 'develop',
    production: 'release'
  }[process.env.NODE_ENV] || 'release'
// #endif

export { env }

export const baseApi = {
  // #ifdef H5
  // 开发版
  develop: '',
  // #endif

  // #ifdef APP-ANDROID || APP-PLUS
  // develop: 'http://192.168.114.42:8800',
  develop: 'https://iot.neoway.com',
  // #endif
  // 体验版
  trial: 'https://iot.neoway.com',
  // 正式版
  release: 'https://iot.neoway.com'
}

// request请求baseURL
export const baseURL = baseApi[env] + '/rest/cook/api/v1'
